import { Injectable, Inject } from '@nestjs/common';

@Injectable()
export class AuthGuardService {
  constructor(@Inject('UserService') private readonly userService) {}

  async validateUser(token: string): Promise<any> {
    // Validate if token passed along with HTTP request
    // is associated with any registered account in the database
    return this.userService.findOneByToken(token);
  }
}
